
package cn.com.open.ms.ecgpaasdatarest.common;

/**
 * 统一API响应结果封装
 */
public class Result {
	private String code = "APPSERVICE-DATAREST";
	private String error;
	private Long timestamp;
	private Object data;

	public Result(String error, Long timestamp, Object data) {
		this.error = error;
		this.timestamp = timestamp;
		this.data = data;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getError() {
		return error;
	}

	public void setError(String error) {
		this.error = error;
	}

	public Long getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(Long timestamp) {
		this.timestamp = timestamp;
	}

	public Object getData() {
		if(data == null) {
			return "";
		}
		return data;
	}

	public Result setData(Object data) {
		this.data = data;
		return this;
	}

}